home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / src / binutils.252 / gas / config / tc-i960.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-27  |  5.5 KB  |  149 lines

  1. /* tc-i960.h - Basic 80960 instruction formats.
  2.    Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  3.  
  4.    This file is part of GAS, the GNU Assembler.
  5.  
  6.    GAS is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as
  8.    published by the Free Software Foundation; either version 2,
  9.    or (at your option) any later version.
  10.  
  11.    GAS is distributed in the hope that it will be useful, but
  12.    WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  14.    the GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public
  17.    License along with GAS; see the file COPYING.  If not, write
  18.    to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  19.  
  20. #ifndef TC_I960
  21. #define TC_I960 1
  22.  
  23. /*
  24.  * The 'COJ' instructions are actually COBR instructions with the 'b' in
  25.  * the mnemonic replaced by a 'j';  they are ALWAYS "de-optimized" if necessary:
  26.  * if the displacement will not fit in 13 bits, the assembler will replace them
  27.  * with the corresponding compare and branch instructions.
  28.  *
  29.  * All of the 'MEMn' instructions are the same format; the 'n' in the name
  30.  * indicates the default index scale factor (the size of the datum operated on).
  31.  *
  32.  * The FBRA formats are not actually an instruction format.  They are the
  33.  * "convenience directives" for branching on floating-point comparisons,
  34.  * each of which generates 2 instructions (a 'bno' and one other branch).
  35.  *
  36.  * The CALLJ format is not actually an instruction format.  It indicates that
  37.  * the instruction generated (a CTRL-format 'call') should have its relocation
  38.  * specially flagged for link-time replacement with a 'bal' or 'calls' if
  39.  * appropriate.
  40.  */
  41.  
  42. /* tailor gas */
  43. #define SYMBOLS_NEED_BACKPOINTERS
  44. #define LOCAL_LABELS_FB
  45. #define BITFIELD_CONS_EXPRESSIONS
  46.  
  47. /* tailor the coff format */
  48. #define BFD_ARCH                bfd_arch_i960
  49. #define COFF_FLAGS                F_AR32WR
  50. #define COFF_MAGIC                I960ROMAGIC
  51. #define OBJ_COFF_SECTION_HEADER_HAS_ALIGNMENT
  52. #define OBJ_COFF_MAX_AUXENTRIES            (2)
  53. #define TC_COUNT_RELOC(FIXP)            (!(FIXP)->fx_done)
  54. #define TC_COFF_FIX2RTYPE(FIXP)            tc_coff_fix2rtype(FIXP)
  55. #define TC_COFF_SIZEMACHDEP(FRAGP)        tc_coff_sizemachdep(FRAGP)
  56. #define TC_COFF_SET_MACHINE(HDRS)        tc_headers_hook (HDRS)
  57. extern void tc_headers_hook ();
  58. extern short tc_coff_fix2rtype ();
  59. extern int tc_coff_sizemachdep ();
  60.  
  61. /* MEANING OF 'n_other' in the symbol record.
  62.  *
  63.  * If non-zero, the 'n_other' fields indicates either a leaf procedure or
  64.  * a system procedure, as follows:
  65.  *
  66.  *    1 <= n_other <= 32 :
  67.  *        The symbol is the entry point to a system procedure.
  68.  *        'n_value' is the address of the entry, as for any other
  69.  *        procedure.  The system procedure number (which can be used in
  70.  *        a 'calls' instruction) is (n_other-1).  These entries come from
  71.  *        '.sysproc' directives.
  72.  *
  73.  *    n_other == N_CALLNAME
  74.  *        the symbol is the 'call' entry point to a leaf procedure.
  75.  *        The *next* symbol in the symbol table must be the corresponding
  76.  *        'bal' entry point to the procedure (see following).  These
  77.  *        entries come from '.leafproc' directives in which two different
  78.  *        symbols are specified (the first one is represented here).
  79.  *
  80.  *
  81.  *    n_other == N_BALNAME
  82.  *        the symbol is the 'bal' entry point to a leaf procedure.
  83.  *        These entries result from '.leafproc' directives in which only
  84.  *        one symbol is specified, or in which the same symbol is
  85.  *        specified twice.
  86.  *
  87.  * Note that an N_CALLNAME entry *must* have a corresponding N_BALNAME entry,
  88.  * but not every N_BALNAME entry must have an N_CALLNAME entry.
  89.  */
  90. #define    N_CALLNAME    ((char)-1)
  91. #define    N_BALNAME    ((char)-2)
  92.  
  93. /* i960 uses a custom relocation record. */
  94.  
  95. /* let obj-aout.h know */
  96. #define CUSTOM_RELOC_FORMAT 1
  97. /* let aout_gnu.h know */
  98. #define N_RELOCATION_INFO_DECLARED 1
  99. struct relocation_info
  100.   {
  101.     int r_address;        /* File address of item to be relocated    */
  102.     unsigned
  103.       r_index:24,        /* Index of symbol on which relocation is based*/
  104.       r_pcrel:1,        /* 1 => relocate PC-relative; else absolute
  105.                  *    On i960, pc-relative implies 24-bit
  106.                  *    address, absolute implies 32-bit.
  107.                  */
  108.       r_length:2,        /* Number of bytes to relocate:
  109.                  *    0 => 1 byte
  110.                  *    1 => 2 bytes
  111.                  *    2 => 4 bytes -- only value used for i960
  112.                  */
  113.       r_extern:1, r_bsr:1,    /* Something for the GNU NS32K assembler */
  114.       r_disp:1,            /* Something for the GNU NS32K assembler */
  115.       r_callj:1,        /* 1 if relocation target is an i960 'callj' */
  116.       nuthin:1;            /* Unused                */
  117.   };
  118.  
  119. #ifdef OBJ_COFF
  120. #define TC_ADJUST_RELOC_COUNT(FIXP,COUNT) \
  121.   { fixS *tcfixp = (FIXP); \
  122.     for (;tcfixp;tcfixp=tcfixp->fx_next) \
  123.       if (tcfixp->fx_tcbit && tcfixp->fx_addsy != 0) \
  124.         ++(COUNT); \
  125.   }
  126. #endif
  127.  
  128. extern int i960_validate_fix PARAMS ((struct fix *, segT, struct symbol **));
  129. #define TC_VALIDATE_FIX(FIXP,SEGTYPE,LABEL) \
  130.     if (i960_validate_fix (FIXP, SEGTYPE, &add_symbolP) != 0) goto LABEL
  131.  
  132. #define tc_fix_adjustable(FIXP)        ((FIXP)->fx_bsr == 0)
  133.  
  134. void brtab_emit PARAMS ((void));
  135. void reloc_callj ();        /* this is really reloc_callj(fixS *fixP) but I don't want to change header inclusion order. */
  136. void tc_set_bal_of_call ();    /* this is really tc_set_bal_of_call(symbolS *callP, symbolS *balP) */
  137.  
  138. char *_tc_get_bal_of_call ();    /* this is really symbolS *tc_get_bal_of_call(symbolS *callP). */
  139. #define tc_get_bal_of_call(c)    ((symbolS *) _tc_get_bal_of_call(c))
  140.  
  141. void i960_handle_align ();
  142. #define HANDLE_ALIGN(FRAG)    i960_handle_align (FRAG)
  143. #define NEED_FX_R_TYPE
  144. #define NO_RELOC -1
  145.  
  146. #endif
  147.  
  148. /* end of tc-i960.h */
  149.